from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client
import logging

secret_id = 'AKIDgBPRCfrmQovlKcVEhz4uUpthFYbNt99t'  # 替换为用户的 secretId
secret_key = 'Xoqc8NN7aomVx94kALFtHPIvHNDsHQJv'  # 替换为用户的 secretKey
region = 'ap-chengdu'  # 替换为用户的 Region

config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)

client = CosS3Client(config)

result = client.head_object(
    Bucket='tangzhiming-1309510181',
    Key='1655122887164_QQ图片20171026195252.jpg'  # 上传到桶之后的文件名
)
print(result)